/*
 * Copyright (c) 2020, 2023, 3044483124@qq.com All rights reserved.
 *
 */
package itcast;

import java.util.Random;

/**
 * <p>Project: JavaStudy - Rand3
 * <p>Powered by jiangbo On 2023-02-04
 * 17:07:02
 * <p>Created by IntelliJ IDEA
 *
 * @author jiangbo [3044483124@qq.com]
 * @version 1.0
 * @since 8/17
 */
public class Rand3 {
    public static void main(String[] args) {
//实现一个抽奖效果，中奖率为30%
        Random rand = new Random();
        int ok = rand.nextInt(1, 101);
        if (ok <= 30) {
            System.out.println("恭喜，你中奖了，" + ok);
        } else {
            System.err.println("遗憾，未中奖.");
        }
    }
}


